package com.ruoyi.info.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.ruoyi.info.mapper.InfoClassMapper;
import com.ruoyi.info.domain.InfoClass;
import com.ruoyi.info.service.IInfoClassService;

import java.util.List;

/**
 * 班级Service业务层处理
 *
 * @author ruoyi
 * @date 2024-09-23
 */
@Service
public class InfoClassServiceImpl extends ServiceImpl<InfoClassMapper, InfoClass> implements IInfoClassService {

    @Override
    public List<InfoClass> queryList(InfoClass infoClass) {
        LambdaQueryWrapper<InfoClass> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(infoClass.getClassName())){
            lqw.like(InfoClass::getClassName ,infoClass.getClassName());
        }
        if (StringUtils.isNotBlank(infoClass.getClassCode())){
            lqw.eq(InfoClass::getClassCode ,infoClass.getClassCode());
        }
        if (StringUtils.isNotBlank(infoClass.getTeacherNo())){
            lqw.eq(InfoClass::getTeacherNo ,infoClass.getTeacherNo());
        }
        return this.list(lqw);
    }

}